package sqlToGUI.sqlRetrievalAlgorithms.array;


import java.sql.SQLException;
import java.sql.Timestamp;

import sqlToGUI.charts.helperUtilities.TelemetryDataEntry;
import sqlToGUI.sqlRetrievalAlgorithms.AbstractDataRetrievalAlgorithm;
import sqlToGUI.sqlRetrievalAlgorithms.SQLDataRetrievalAlgorithm;


public class Alg_ArrayPowerMap extends AbstractDataRetrievalAlgorithm  
	implements SQLDataRetrievalAlgorithm {

	private int counter1 = 0;
	private int counter2 = 1;
	private int counter3 = 2;
	private int counter4 = 3;
	private int counter5 = 4;
	private int counter6 = 5;
	private int counter7 = 6;
	private int counter8 = 7;
	private int counter9 = 8;
	private int counter10 = 9;
	private int counter11 = 10;
	private int counter12 = 11;
	
	/**Class constructor */
	public Alg_ArrayPowerMap(TelemetryDataEntry [] list){		
		super();
		this.list = list;
	}
	
	/**Access the database and update data in the buffer */
	public void updateData(){
		
		/**Test Data */
		double t1 = (100*Math.sin(counter1/10.0)*Math.sin(counter1/10.0));
		list[0].updateData(0, t1);
		double t2 = (100*Math.sin(counter2/10.0)*Math.sin(counter2/10.0));
		list[0].updateData(1, t2);
		double t3 = (100*Math.sin(counter3/10.0)*Math.sin(counter3/10.0));
		list[0].updateData(2, t3);
		double t4 = (100*Math.sin(counter4/10.0)*Math.sin(counter4/10.0));
		list[0].updateData(3, t4);
		double t5 = (100*Math.sin(counter5/10.0)*Math.sin(counter5/10.0));
		list[0].updateData(4, t5);
		double t6 = (100*Math.sin(counter6/10.0)*Math.sin(counter6/10.0));
		list[0].updateData(5, t6);
		double t7 = (100*Math.sin(counter7/10.0)*Math.sin(counter7/10.0));
		list[0].updateData(6, t7);
		double t8 = (100*Math.sin(counter8/10.0)*Math.sin(counter8/10.0));
		list[0].updateData(7, t8);
		double t9 = (100*Math.sin(counter9/10.0)*Math.sin(counter9/10.0));
		list[0].updateData(8, t9);
		double t10 = (100*Math.sin(counter10/10.0)*Math.sin(counter10/10.0));
		list[0].updateData(9, t10);
		double t11 = (100*Math.sin(counter11/10.0)*Math.sin(counter11/10.0));
		list[0].updateData(10, t11);
		double t12 = (100*Math.sin(counter12/10.0)*Math.sin(counter12/10.0));
		list[0].updateData(11, t12);
		
		counter1++;
		counter2++;
		counter3++;
		counter4++;
		counter5++;
		counter6++;
		counter7++;
		counter8++;
		counter9++;
		counter10++;
		counter11++;
		counter12++;
		/**End of test data */
		
	}
	
}
